#ifndef _APPS_BDESKTOP_CVOLUME_H_
#define _APPS_BDESKTOP_CVOLUME_H_

#include "auto.h"
#include "cimageicon.h"
#include <buola/system/cdiskdevice.h>

namespace buola { namespace bdesktop {

class CVolume : public UUncopiable, public UTrackable
{
    enum EObject
    {
        DRIVE,
        VOLUME
    };

public:
    CVolume(CVolumeManager *pManager,system::PDiskDevice pDevice);
    ~CVolume();
    
    bool IsMounted();
    TFileSize GetCapacity();
    TFileSize GetAvailable();

    bool ShouldAutomount();
    void Mount();
    void Unmount();
    void Eject(bool pUnmount);

    bool ShouldBeInDock();
    void PlaceInDock();
    void RemoveFromDock();

    bool ShouldBeInPlacesMenu();
    void AddToPlacesMenu(gui::PMenu pMenu);

    void LaunchBrowser();

    void OnIconClicked(gui::CMouseEvent *pE);
    void OnPropertyChanged(EObject pObj,const std::string &pProp);
    void OnCondition(EObject pObj,const std::string &pName,const std::string &pDetail);
    
private:
    CVolumeManager *mManager;
    system::PDiskDevice mVolume;
    system::PDiskDevice mDrive;

    CImageIcon *mIcon;

    bool mEjectPending;
};

/*namespace bdesktop*/ } /*namespace buola*/ }

#endif
